<template>
  <div>About</div>
  <span>展示count ： {{ $store.state.count }}</span>
  <br />
  <span>展示name ： {{ $store.state.info.name }}</span>
  <br />
  <button @click="incrementS()">点击</button>
  <button @click="changeName({ name: 'fff' })">changeName</button>
</template>

<script>
import useMapMutationstoSetup from '../hooks/useMapMutationstoSetup'
import { mapMutations, useStore } from 'vuex'
export default {
  setup() {
    const { increment } = mapMutations(['increment'])
    const incrementS = increment.bind({ $store: useStore() })
    // 自定义hooks实现
    const { changeName } = useMapMutationstoSetup(['changeName'])
    return { incrementS, changeName }
  },
}
</script>

<style lang="scss" scoped></style>
